import QtQuick 2.0
import QtQuick.Controls 1.4


Item {
    width: 100
    height: 200

    ListModel {
        id: libraryModel
//        ListElement {
//            num: 1
//            fileName:"text1.midi"
//        }
    }

    TableView {
        anchors.fill: parent
        TableViewColumn {
            role: "num"
            title: "序号"
            width: 100
        }
        TableViewColumn {
            role: "fileName"
            title: "文件"
            width: 200
        }
        model: libraryModel
    }

    function appendItem(filePath)
    {
        console.log("append " + filePath)
        libraryModel.append({"num":libraryModel.count + 1,"fileName":filePath})
    }
}
